﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Arcana.Contract.Tests.Method.Returns.Has
{
    [TestClass]
    public class AllAttributeTest
    {
        [Arcana.Contract.Method.Returns.Has.All(new object[] { 1, 2, 3})]
        public static int[] Target(int[] x)
        {
            return x;
        }

        [TestMethod]
        [Owner("arcane_master_cp")]
        [WorkItem(55)]
        [ExpectedException(typeof(InvalidOperationException))]
        public void ShouldThrowException_1()
        {
            Target(new int[] { });
        }

        [TestMethod]
        [Owner("arcane_master_cp")]
        [WorkItem(55)]
        [ExpectedException(typeof(InvalidOperationException))]
        public void ShouldThrowException_2()
        {
            Target(new int[] { 1, 5, 2 });
        }

        [TestMethod]
        [Owner("arcane_master_cp")]
        [WorkItem(55)]
        public void ShouldPass()
        {
            Target(new int[] { 4, 5, 6, 7, 3, 5, 10, 9, 1, 444, 556, 55, 2, 4435, 345, 345345 });
        }
    }
}
